home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1997 / HAM Radio 1997.iso / vcls / wsanet8a / wsanet / src / wsanet.h < prev    next >
C/C++ Source or Header  |  1996-04-08  |  4KB  |  153 lines

  1. /* WSANet.H */
  2. #ifndef WSANet_H
  3. #define WSANet_H
  4.  
  5. #include <Windows.h>
  6. #include <VBAPI.H>      // You need the CDK to compile WSNetC.VBX
  7. #include <WinSock.h>    // WinSock.h is included with this distribution
  8. #include "Topics.h"
  9. #include "Version.h"
  10. #include "Errors.h"
  11.  
  12.     /* Conditional compilation #defines */
  13. #define DESIGN_TIME     // Undefine this to take out all design time code
  14. #define FULL_DEBUG      // Undefine this to take all of the debugging messages
  15.  
  16. #define DEBUG_BUILD     // Undefine this for the debugging version
  17.  
  18. #ifdef DEBUG_BUILD
  19. #else
  20. #define DEBUGIT( param )
  21. #endif /* DEBUG_BUILD */
  22.  
  23. //#define VB100_CDK // define this if you have the VB 1.00 CDK
  24. //#define VB200_CDK // define this if you have the VB 2.00 CDK
  25. #define VB300_CDK   // define this if you have the VB 3.00 CDK
  26.  
  27.  
  28. //#define USE_VCPP  // define this if you are using VC++ and want to avoid
  29.                     // it's overactive warnings. ;)
  30.  
  31. /* Each one has the features of the previous */
  32. #ifdef VB300_CDK
  33. #define VB200_CDK
  34. #define VB100_CDK
  35. #else
  36. #ifdef VB200_CDK
  37. #define VB100_CDK
  38. #else
  39. #ifndef VB100_CDK
  40. #define VB100_CDK
  41. #endif /* VB100_CDK */
  42. #endif /* VB200_CDK */
  43. #endif /* VB300_CDK */
  44.  
  45.  
  46.     /* Common #define(s) */
  47.  
  48. #define CM_NETACTIVITY   WM_USER+1
  49.  
  50. #ifdef DESIGN_TIME
  51. #define CM_OPENABOUTDLG  WM_USER+2
  52.  
  53. #define CLASS_ABOUTPOPUP "AboutWSetClass"
  54. #define CONTROLNAME      "WSANet VBX"
  55. #define WSANET_HELPFILE  "wsanet.hlp"
  56.  
  57. #define STRING_ABOUTTEXT "About WSANet.VBX"
  58. #define STRING_WRITEONLY "*Write only*"
  59. #define STRING_WRONGTITL "WSANET.VBX Run-time problem"
  60.  
  61. #endif // DESIGN_TIME
  62.  
  63.  
  64.     /* PROTOTYPEs */
  65. typedef HLSTR MOLE;
  66. typedef HLSTR FAR *LPMOLE;
  67.  
  68. #ifdef __cplusplus
  69. extern "C" {            /* Assume C declarations for C++ */
  70. #endif  /* __cplusplus */
  71.  
  72. #ifdef DEBUG_BUILD
  73. VOID DEBUGIT(LPSTR);
  74. #endif /* DEBUG_BUILD */
  75.  
  76. // Functions in WSANet.C
  77. BOOL  DisplayHelpTopic(WORD, WPARAM, LPMODEL);
  78. BOOL  bHelpStdPropEvt(WPARAM, LPMODEL);
  79.  
  80. // Functions in NetSrvr.C
  81. LONG  CALLBACK _export NetServerCtlProc(HCTL, HWND, UINT, WPARAM, LPARAM);
  82. ERR   NetServerError(HCTL, int);
  83. ERR   serverFireOnError(HCTL);
  84.  
  85. // Functions in NetClnt.C
  86. LONG  CALLBACK _export NetClientCtlProc(HCTL, HWND, UINT, WPARAM, LPARAM);
  87. int   CALLBACK _export NetClientSendBlock(HCTL, HLSTR);
  88. int   CALLBACK _export NetClientRecvBlock(HCTL, HLSTR, int);
  89. BOOL  CALLBACK _export AboutDlgProc(HWND, UINT, WPARAM, LPARAM);
  90. LONG  CALLBACK _export AboutWndProc(HWND, UINT, WPARAM, LPARAM);
  91. ERR   NetClientError(HCTL, int);
  92. ERR   clientFireOnConnect(HCTL);
  93. ERR   clientFireOnRecv(HCTL);
  94. ERR   clientFireOnSend(HCTL);
  95. ERR   clientFireOnClose(HCTL);
  96. ERR   clientFireOnTimeOut(HCTL);
  97. ERR   clientFireOnError(HCTL);
  98.  
  99. // Functions in Net.C
  100. BOOL  netStartup(VOID);
  101. VOID  netCleanup(VOID);
  102. BOOL  netCloseSocket(HWND, SOCKET);
  103. BOOL  netConnect(HCTL, SOCKET);
  104. BOOL  netAccept(HCTL, SOCKET);
  105. LONG  netClientAsyncProc(HCTL, HWND, WPARAM, LPARAM);
  106. LONG  netServerAsyncProc(HCTL, HWND, WPARAM, LPARAM);
  107. ERR   netSendData(HCTL);
  108. int   netRecvData(HCTL);
  109. int   putSendData(HCTL, MOLE);
  110. HLSTR getRecvData(HCTL);
  111. HSZ   getRecvLine(HCTL);
  112. ERR   netReturnError(ERR, int, LPSTR);
  113. HSZ   GetMoleHsz(HCTL, MOLE);
  114. VOID  GetMoleName(MOLE, LPSTR, int);
  115. VOID  SetMole(LPMOLE, LPSTR);
  116. MOLE  AddMole(LPSTR);
  117. MOLE  CreateMole(LPSTR, USHORT);
  118. VOID  DeleteMole(MOLE);
  119.  
  120. // Functions in Ini.C
  121. LONG  CALLBACK _export IniCtlProc(HCTL, HWND, UINT, WPARAM, LPARAM);
  122.  
  123.  
  124. // Functions in WSANet.C
  125. int   CALLBACK LibMain(HANDLE, WORD, WORD, LPSTR);
  126. BOOL  CALLBACK _export VBINITCC(USHORT, BOOL);
  127. VOID  CALLBACK _export VBTERMCC(VOID);
  128.  
  129. #ifdef __cplusplus
  130.  }           /* Assume C declarations for C++ */
  131. #endif  /* __cplusplus */
  132.  
  133.     /* Type definitions */
  134. #ifndef LPHSZ            // Define LPHSZ for FAR HSZ *
  135. typedef HSZ FAR * LPHSZ; // Why doesn't VBAPI.H have this
  136. //typedef HLSTR FAR * LPHLSTR;
  137. #endif // LPHSZ
  138.  
  139.     /* Globals */
  140. #ifdef NetClnt_C
  141. HANDLE hModDLL;
  142. BOOL   bDialogInUse = FALSE;       // Don't pop up more than 1 About
  143. HWND   hDialogHwnd  = 0;           // Invisible popup window handle
  144. #else
  145. extern HANDLE hModDLL;
  146. extern BOOL   bDialogInUse;
  147. extern HWND   hDialogHwnd;
  148. #endif
  149.  
  150. #endif /* WSANet_H */
  151.  
  152. /* End of WSANet.H */
  153.